package com.hznu.jspFinal.service;


import com.hznu.jspFinal.dao.QuestionTypeMapper;
import com.hznu.jspFinal.entity.QuestionType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionTypeServiceImpl implements QuestionTypeService {
    @Autowired
    private QuestionTypeMapper questionTypeMapper;

    @Override
    public void insert(QuestionType questionType) {
        questionTypeMapper.insertSelective(questionType);
    }

    @Override
    public void update(QuestionType questionType) {
        questionTypeMapper.updateByPrimaryKeySelective(questionType);
    }

    @Override
    public void delete(Integer id) {
        questionTypeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<QuestionType> selectAll() {
        return questionTypeMapper.selectAll();
    }

    @Override
    public QuestionType select(Integer id) {
        return questionTypeMapper.selectByPrimaryKey(id);
    }
}
